const routes = [
  {
    path: "/login",
    name: "Login",
    component: () => import("../views/Login.vue"),
  },
  {
    path: "/",
    component: () => import("@/views/layout"),
    redirect: "/home", // 展示整体布局后立刻重定向到子组件 Home
    children: [
      {
        path: "/home",
        name: "Home",
        component: () => import("../views/Home.vue"),
      },
      {
        path: "/pet",
        name: "Pet",
        component: () => import("../views/Pet.vue"),
      },
      {
        path: "/adopt",
        name: "Adopt",
        component: () => import("../views/Adopt.vue"),
      },
      {
        path: "/order",
        name: "Order",
        component: () => import("../views/Order.vue"),
      },
      {
        path: "/user",
        name: "User",
        component: () => import("../views/User.vue"),
      },
      {
        path: "/petfood",
        name: "PetFood",
        component: () => import("../views/PetFood.vue"),
      },
      {
        path: "/essay",
        name: "Essay",
        component: () => import("../views/Essay.vue"),
      },
      {
        path: "/comment",
        name: "Comment",
        component: () => import("../views/Comment.vue"),
      },
      {
        path: "/essayEdit",
        name: "EssayEdit",
        component: () => import("../views/EssayEdit.vue"),
      },
      {
        path: "/commentEdit",
        name: "CommentEdit",
        component: () => import("../views/CommentEdit.vue"),
      },
    ],
  },
];

export default routes;
